package com.ddd.domain.user.event;

import com.ddd.domain.user.entity.UserDo;
import org.springframework.stereotype.Component;

@Component
public class UserEvent {

    /**
     * 年龄大于18-触发,发短信事件
     */
    public  void ageGreater18(UserDo user){
        if (user.getAge()>18) {

            String name = user.getName();
            System.out.println("调用发短信的接口给"+name+"用户发短信");

        }

    }

}
